package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IMarkImsiCountDAO;
import org.jsbd.boss.domian.statistics.MarkImsiCountBean;
import org.jsbd.boss.domian.statistics.MarkImsiCountVO;
import org.springframework.stereotype.Repository;

@Repository("markImsiCountDAO")
public class MarkImsiCountDAOImpl extends CrackStatisticsBaseDao implements IMarkImsiCountDAO {

	@Override
	public Map<String, Object> findCurrentMonth(DataGridModel page, MarkImsiCountVO markImsiCountVO) {
		markImsiCountVO = (markImsiCountVO == null ? new MarkImsiCountVO() : markImsiCountVO);
		markImsiCountVO.setPageInfo(page);
		
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("rows", super.queryForList("qy_mark_imsi_count.SELECT_CURRENT_MONTH_LIST", markImsiCountVO));
	    results.put("total", super.queryForCount("qy_mark_imsi_count.SELECT_CURRENT_MONTH_COUNT", markImsiCountVO));
		return results;
	}

	@Override
	public List<Integer> getCurrentMonthCounts(MarkImsiCountVO markImsiCountVO) {
		return super.queryForList("qy_mark_imsi_count.SELECT_CURRENT_MONTH_COUNTS", markImsiCountVO);
	}

	@Override
	public MarkImsiCountBean getCurrentMonthNum(MarkImsiCountVO markImsiCountVO) {
		return (MarkImsiCountBean) super.queryForObject("qy_mark_imsi_count.SELECT_CURRENT_MONTH_NUM", markImsiCountVO);
	}

	@Override
	public Map<String, Object> findNextMonth(DataGridModel page, MarkImsiCountVO markImsiCountVO) {
		markImsiCountVO = (markImsiCountVO == null ? new MarkImsiCountVO() : markImsiCountVO);
		markImsiCountVO.setPageInfo(page);
		
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("rows", super.queryForList("qy_mark_imsi_count.SELECT_NEXT_MONTH_LIST", markImsiCountVO));
	    results.put("total", super.queryForCount("qy_mark_imsi_count.SELECT_NEXT_MONTH_COUNT", markImsiCountVO));
		return results;
	}

	@Override
	public List<Integer> getNextMonthCounts(MarkImsiCountVO markImsiCountVO) {
		return super.queryForList("qy_mark_imsi_count.SELECT_NEXT_MONTH_COUNTS", markImsiCountVO);
	}

	@Override
	public MarkImsiCountBean getNextMonthNum(MarkImsiCountVO markImsiCountVO) {
		return (MarkImsiCountBean) super.queryForObject("qy_mark_imsi_count.SELECT_NEXT_MONTH_NUM", markImsiCountVO);
	}

}
